<!DOCTYPE HTML>
<!-- <no_layout name="Layout\layout" />  -->
<div id="main-collect-page">
<style type="text/css">
.analysis{
	color:red;
}
.div_analysis ul li{
	margin-bottom:0.6em;
}
#btn_submit{
		text-align:right;
	}
@media (max-width: 768px){
	#btn_submit{
		text-align:left;
	}
</style>

	<!-- main content start-->			
	<h3 class="title1">作业互评 :</h3>
	<div class="form-three widget-shadow card pressthis">
		<form class="form-horizontal" method="post">							
		<div class="form-group">
			
			<div class="col-sm-8">
				<select name="selector1" id="selector1" class="form-control1">
					<option selected="true" value=''>请选择要评价的任务...</option>
					<volist name='responselist' id="vo">
					<option value="{$vo.id}">互评-{$vo.ex_name}</option>
					</volist>
				</select>
			</div>
		</div>			
					
		<div class="forms">
			<button class="btn btn-default" id="setItemList">Confirm</button>
		</div>
			<input name="openid" id="openid" value="{$openid}" type="hidden"  />
		</form>
	</div>
	<div id="detail_page">
		<div id="myLoading"></div>
	</div>
	
	
		 <script>
			//console.log('对象：',obj1);
		
			var num =new Array();
			function radio(checkbox) {
			//alert(checkbox);
				var optname = $(checkbox).attr("name");
				if(num.indexOf(optname)<0){
					num.push(optname);
				}
				$('input[name='+optname+']').prop('checked', false);
				$(checkbox).prop('checked',true);
				answer = $(checkbox).attr("id");
		    }

			var url = document.URL;
			if(url.indexOf("test_num") != -1){
				$("html,body").animate({scrollTop:$("#content-tabs").offset().top-$("#main-collect-page").offset().top},500);	
			}
			function changeMark()
			{																								
				$('#mark').attr("disabled","disabled");																	
				$('#mark').css('color','#777');	
							
			}			
			if('{$isExercise}' == "0"){
				$('#analysis-tab').hide();
				$("#exerciseTip").hide();
				
			}
			
			//实现每5s获取答题人数的功能
			function getSubmitNum() { 
				var ajaxData ={};
				ajaxData['test_num_id']=$("#test_num_id").val();			
				$.post("{:U('Inclass/getSubmitNum')}",ajaxData,
					function(data) { 
					var d = data.toString(); 
					$("#person_num").html("已提交："+d+"人"); 
				});
			} 
			$(function() { 
				//timeID = setInterval('getSubmitNum()', 5000); //注意:执行的函数需要加引号,否则会报错的 
			}); 
			//===========================
			$("#submit").click(function(){
				for(var i=0;i<{$i};i++){
					if(num.length<{$i}){
						//alert("请填写所有试题");						
						//return false;
				 
					}
				}
				
			});
			$("#setItemList").click(function(event){				
				
				event.preventDefault();	
				$("#myLoading").show();
					if($("#selector1").val() == ''){
						alert("请选择任务！");
						return false;
					}
							
				var ajaxData ={};
				ajaxData['chapter'] = $("#selector1").val();
				ajaxData["openid"] 	= $('#openid').val();				
				ajaxData["ex_name"] 	= $('#selector1  option:selected').text();				
				//ajaxData['__hash__'] = $('[name=__hash__]').attr('content');		
				//ajaxData['__hash__'] = document.getElementsByName("__hash__")[0].content;		
				$.post("{:U('Homework/getPeerDetail')}",
					ajaxData,
					function(data,status){
					// alert("Data: " + data + "nStatus: " + status);
						$("#detail_page").html(data);
				});
				//$("html").text(jsApiParameters);
				//window.location.reload();		
			});
			
		
		</script> 
	<!-- main content end-->
</div>